package com.neuedu.his.controller;

import com.neuedu.his.po.Constantitem;
import com.neuedu.his.service.ConstantitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/master/constant/item")
public class ConstantItemController {

    @Autowired
    private ConstantitemService constantItemService;


    @GetMapping("/list")
    public List<Constantitem> list() {
        return constantItemService.list();
    }


    @GetMapping("/getById/{id}")
    public Constantitem getById(@PathVariable Long id) {
        return constantItemService.getById(id);
    }


    @PostMapping("/saveOrUpdate")
    public boolean saveOrUpdate(@RequestBody Constantitem item) {
        return constantItemService.saveOrUpdate(item);
    }


    @DeleteMapping("/deleteById/{id}")
    public boolean deleteById(@PathVariable Long id) {
        return constantItemService.removeById(id);
    }
}
